package coreentity

import (
	"core/class"
	"core/corestruct"
	"core/datetime"
	"core/selfreg"
	"reflect"
)

type HtUserLogin struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;comment:主键;autoIncrement:false;"`

	Token      string                 `json:"token"        validate:"required,max=50"gorm:"column:token;size:50;DEFAULT:'';not null;comment:Token;"`
	Name       string                 `json:"name"         validate:"required,max=50"gorm:"column:name;size:50;DEFAULT:'';not null;comment:姓名;"`
	HtdeptId   int64                  `json:"htdeptId,string"                    gorm:"column:htdept_id;DEFAULT:0;not null;comment:机构编码;"`
	HtdeptName string                 `json:"htdeptName"   validate:"max=100"  gorm:"column:htdept_name;size:100;DEFAULT:'';not null;comment:机构名称;"`
	HtroleData string                 `json:"-"   validate:"max=200"  gorm:"column:htrole_data;size:200;DEFAULT:'';not null;comment:角色数据;memo:BaseDto 数组,json格式;"`
	Htroles    []corestruct.IdNameDto `json:"htroles"                          gorm:"-;comment:HTRoles;"`
	HtplatId   int64                  `json:"htplatId,string"                    gorm:"column:htplat_id;DEFAULT:0;not null;comment:平台编号;"`
	Loginway   string                 `json:"loginway"     validate:"max=10"   gorm:"column:loginway;size:10;DEFAULT:'';not null;comment:登录方式;memo:Appver、IMSI;"`
	Extra      string                 `json:"extra"                            gorm:"column:extra;DEFAULT:'';not null;comment:额外信息;memo:网站、小程序、安卓终端;"`
	Ip         string                 `json:"ip"           validate:"max=50"   gorm:"column:ip;size:50;DEFAULT:'';not null;comment:IP;"`
	Os         string                 `json:"os"           validate:"max=50"   gorm:"column:os;size:50;DEFAULT:'';not null;comment:OS;"`
	Imsi       string                 `json:"imsi"         validate:"max=50"   gorm:"column:imsi;size:50;DEFAULT:'';not null;comment:IMSI;"`
	Browser    string                 `json:"browser"      validate:"max=50"   gorm:"column:browser;size:50;DEFAULT:'';not null;comment:浏览器;"`
	Appver     string                 `json:"appver"       validate:"max=20"   gorm:"column:appver;size:20;DEFAULT:'';not null;comment:App版本;"`
	CrtDt      datetime.MyTime        `json:"crtDt"                            gorm:"column:crt_dt;not null;comment:创建日期;"`
	CrtUid     int64                  `json:"crtUid,string"                    gorm:"column:crt_uid;DEFAULT:0;not null;comment:用户编号;"`
	CrtDid     int64                  `json:"crtDid,string"                    gorm:"column:crt_did;DEFAULT:0;not null;comment:机构编号;"`
	EdtDt      datetime.MyTime        `json:"edtDt"                            gorm:"column:edt_dt;not null;comment:更新日期;"`
	EdtUid     int64                  `json:"edtUid,string"                    gorm:"column:edt_uid;DEFAULT:0;not null;comment:更新用户编号;"`
	EdtUrl     string                 `json:"edtUrl"       validate:"max=20"   gorm:"column:edt_url;size:20;DEFAULT:'';not null;comment:最近访问地址;"`
	Online     bool                   `json:"online"                           gorm:"column:online;not null;comment:在线状态;"`
	LogoutDt   datetime.MyTime        `json:"logoutDt"                         gorm:"column:logout_dt;not null;comment:注销日期;"`
	LogoutMemo string                 `json:"logoutMemo"   validate:"max=100"  gorm:"column:logout_memo;size:100;DEFAULT:'';not null;comment:注销备注;"`
	Debug      bool                   `json:"debug"                            gorm:"column:debug;not null;comment:是否调试;"`
}

func (p *HtUserLogin) TableName() string {
	return "HtUserLogin"
}

func init() {

	var mcls = &HtUserLogin{}
	var m = &class.MyClass{
		Name:     "在线用户表",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddEntity(m)
}
